<template>
    <div class="h">
        <router-link :to="{name:'login'}">登录</router-link>
        <button @click="goBack">返回</button>
    </div>
</template>
<script>
export default {
    data() {
        return {

        }
    }, methods: {
        goBack() {
            this.$router.go(-1); //根据历史记录前一步
        }
    }
}
</script>
<style>
.h {
    height: 50px;
    background-color: skyblue;
}
</style>
